using System;
using System.Linq;
using System.Data.Objects;
using System.Data.Objects.DataClasses;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Collections.Generic;
using Acme.Northwind.EFDAL.Entity;

[assembly: EdmSchemaAttribute()]
#region EDM Relationship Metadata

[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__Product_Category", "Category", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Acme.Northwind.EFDAL.Entity.Category), "ProductList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Product), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK_Customercustomerdemo_CustomerCustomerDemo_CustomerDemographic", "CustomercustomerdemoCustomerDemographic", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.CustomerDemographic), "CustomercustomerdemoCustomerCustomerDemoList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__CustomerCustomerDemo_Customer", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.Customer), "CustomerCustomerDemoList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__Order_Customer", "Customer", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Acme.Northwind.EFDAL.Entity.Customer), "OrderList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Order), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK_ReportTo_Employee_Employee", "ReportToEmployee", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Acme.Northwind.EFDAL.Entity.Employee), "ReportToEmployeeList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Employee), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__EmployeeTerritorie_Employee", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.Employee), "EmployeeTerritorieList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.EmployeeTerritorie), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__Order_Employee", "Employee", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Acme.Northwind.EFDAL.Entity.Employee), "OrderList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Order), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK_Order_details_orders_OrderDetail_Order", "Order_details_ordersOrder", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.Order), "Order_details_ordersOrderDetailList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.OrderDetail), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK_Order_details_products_OrderDetail_Product", "Order_details_productsProduct", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.Product), "Order_details_productsOrderDetailList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.OrderDetail), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__Territory_Region", "Region", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.Region), "TerritoryList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Territory), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__Order_Shipper", "Shipper", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Acme.Northwind.EFDAL.Entity.Shipper), "OrderList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Order), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__Product_Supplier", "Supplier", System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(Acme.Northwind.EFDAL.Entity.Supplier), "ProductList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.Product), true)]
[assembly: EdmRelationshipAttribute("Acme.Northwind.EFDAL.Entity", "FK__EmployeeTerritorie_Territory", "Territory", System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(Acme.Northwind.EFDAL.Entity.Territory), "EmployeeTerritorieList", System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(Acme.Northwind.EFDAL.Entity.EmployeeTerritorie), true)]

#endregion

namespace Acme.Northwind.EFDAL
{
	#region EntityMappingConstants Enumeration

	/// <summary>
	/// A map for all entity types in this library
	/// </summary>
	public enum EntityMappingConstants
	{
		/// <summary>
		/// A mapping for the the Category entity
		/// </summary>
		Category,
		/// <summary>
		/// A mapping for the the Customer entity
		/// </summary>
		Customer,
		/// <summary>
		/// A mapping for the the CustomerCustomerDemo entity
		/// </summary>
		CustomerCustomerDemo,
		/// <summary>
		/// A mapping for the the CustomerDemographic entity
		/// </summary>
		CustomerDemographic,
		/// <summary>
		/// A mapping for the the Employee entity
		/// </summary>
		Employee,
		/// <summary>
		/// A mapping for the the EmployeeTerritorie entity
		/// </summary>
		EmployeeTerritorie,
		/// <summary>
		/// A mapping for the the Order entity
		/// </summary>
		Order,
		/// <summary>
		/// A mapping for the the OrderDetail entity
		/// </summary>
		OrderDetail,
		/// <summary>
		/// A mapping for the the Product entity
		/// </summary>
		Product,
		/// <summary>
		/// A mapping for the the Region entity
		/// </summary>
		Region,
		/// <summary>
		/// A mapping for the the Shipper entity
		/// </summary>
		Shipper,
		/// <summary>
		/// A mapping for the the Supplier entity
		/// </summary>
		Supplier,
		/// <summary>
		/// A mapping for the the Territory entity
		/// </summary>
		Territory,
	}

	#endregion

	#region Entity Context

	/// <summary>
	/// There context NorthwindEntities
	/// </summary>
	[System.CodeDom.Compiler.GeneratedCode("nHydrateModelGenerator", "5.0.1.100")]
	public partial class NorthwindEntities : System.Data.Objects.ObjectContext, Acme.Northwind.EFDAL.Interfaces.INorthwindEntities
	{
		/// <summary>
		/// The audit modifier used to mark database edits
		/// </summary>
		protected ContextStartup _contextStartup = new ContextStartup(null);

		/// <summary>
		/// Initializes a new NorthwindEntities object using the connection string found in the 'NorthwindEntities' section of the application configuration file.
		/// </summary>
		public NorthwindEntities() :
			base("name=NorthwindEntities", "NorthwindEntities")
		{
			this.OnContextCreated();
		}

		/// <summary>
		/// Initialize a new NorthwindEntities object with an audit modifier.
		/// </summary>
		public NorthwindEntities(ContextStartup contextStartup) :
			base("name=NorthwindEntities", "NorthwindEntities")
		{
			_contextStartup = contextStartup;
			this.ContextOptions.LazyLoadingEnabled = contextStartup.AllowLazyLoading;
			this.CommandTimeout = contextStartup.CommandTimeout;
			this.OnContextCreated();
		}

		/// <summary>
		/// Initialize a new NorthwindEntities object.
		/// </summary>
		public NorthwindEntities(string connectionString) :
			base(connectionString, "NorthwindEntities")
		{
			this.OnContextCreated();
		}

		/// <summary>
		/// Initialize a new NorthwindEntities object.
		/// </summary>
		public NorthwindEntities(System.Data.EntityClient.EntityConnection connection) :
			base(connection, "NorthwindEntities")
		{
			this.OnContextCreated();
		}

		partial void OnContextCreated();

		partial void OnContextCreated()
		{
			// set the Context reference whenever an entity is loaded
			this.ObjectMaterialized += (sender, e) =>
			{
				var o = ((e.Entity as nHydrate.EFCore.DataAccess.IReadOnlyBusinessObject) as IEntityWithContext);
				if (o != null) o.Context = this;
			};
		}

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Category> Category
		{
			get
			{
				lock (_lockercategory)
				{
					if ((this._category == null))
					{
						this._category = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Category>("Category");
					}
					return this._category;
				}
			}
		}

		private object _lockercategory = new object();

		/// <summary>
		/// The internal reference variable for the 'Category' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Category> _category;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Customer> Customer
		{
			get
			{
				lock (_lockercustomer)
				{
					if ((this._customer == null))
					{
						this._customer = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Customer>("Customer");
					}
					return this._customer;
				}
			}
		}

		private object _lockercustomer = new object();

		/// <summary>
		/// The internal reference variable for the 'Customer' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Customer> _customer;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo> CustomerCustomerDemo
		{
			get
			{
				lock (_lockercustomercustomerdemo)
				{
					if ((this._customercustomerdemo == null))
					{
						this._customercustomerdemo = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo>("CustomerCustomerDemo");
					}
					return this._customercustomerdemo;
				}
			}
		}

		private object _lockercustomercustomerdemo = new object();

		/// <summary>
		/// The internal reference variable for the 'CustomerCustomerDemo' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo> _customercustomerdemo;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CustomerDemographic> CustomerDemographic
		{
			get
			{
				lock (_lockercustomerdemographic)
				{
					if ((this._customerdemographic == null))
					{
						this._customerdemographic = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.CustomerDemographic>("CustomerDemographic");
					}
					return this._customerdemographic;
				}
			}
		}

		private object _lockercustomerdemographic = new object();

		/// <summary>
		/// The internal reference variable for the 'CustomerDemographic' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CustomerDemographic> _customerdemographic;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Employee> Employee
		{
			get
			{
				lock (_lockeremployee)
				{
					if ((this._employee == null))
					{
						this._employee = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Employee>("Employee");
					}
					return this._employee;
				}
			}
		}

		private object _lockeremployee = new object();

		/// <summary>
		/// The internal reference variable for the 'Employee' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Employee> _employee;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.EmployeeTerritorie> EmployeeTerritorie
		{
			get
			{
				lock (_lockeremployeeterritorie)
				{
					if ((this._employeeterritorie == null))
					{
						this._employeeterritorie = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.EmployeeTerritorie>("EmployeeTerritorie");
					}
					return this._employeeterritorie;
				}
			}
		}

		private object _lockeremployeeterritorie = new object();

		/// <summary>
		/// The internal reference variable for the 'EmployeeTerritorie' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.EmployeeTerritorie> _employeeterritorie;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Order> Order
		{
			get
			{
				lock (_lockerorder)
				{
					if ((this._order == null))
					{
						this._order = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Order>("Order");
					}
					return this._order;
				}
			}
		}

		private object _lockerorder = new object();

		/// <summary>
		/// The internal reference variable for the 'Order' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Order> _order;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrderDetail> OrderDetail
		{
			get
			{
				lock (_lockerorderdetail)
				{
					if ((this._orderdetail == null))
					{
						this._orderdetail = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.OrderDetail>("OrderDetail");
					}
					return this._orderdetail;
				}
			}
		}

		private object _lockerorderdetail = new object();

		/// <summary>
		/// The internal reference variable for the 'OrderDetail' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrderDetail> _orderdetail;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Product> Product
		{
			get
			{
				lock (_lockerproduct)
				{
					if ((this._product == null))
					{
						this._product = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Product>("Product");
					}
					return this._product;
				}
			}
		}

		private object _lockerproduct = new object();

		/// <summary>
		/// The internal reference variable for the 'Product' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Product> _product;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Region> Region
		{
			get
			{
				lock (_lockerregion)
				{
					if ((this._region == null))
					{
						this._region = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Region>("Region");
					}
					return this._region;
				}
			}
		}

		private object _lockerregion = new object();

		/// <summary>
		/// The internal reference variable for the 'Region' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Region> _region;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Shipper> Shipper
		{
			get
			{
				lock (_lockershipper)
				{
					if ((this._shipper == null))
					{
						this._shipper = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Shipper>("Shipper");
					}
					return this._shipper;
				}
			}
		}

		private object _lockershipper = new object();

		/// <summary>
		/// The internal reference variable for the 'Shipper' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Shipper> _shipper;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Supplier> Supplier
		{
			get
			{
				lock (_lockersupplier)
				{
					if ((this._supplier == null))
					{
						this._supplier = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Supplier>("Supplier");
					}
					return this._supplier;
				}
			}
		}

		private object _lockersupplier = new object();

		/// <summary>
		/// The internal reference variable for the 'Supplier' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Supplier> _supplier;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Territory> Territory
		{
			get
			{
				lock (_lockerterritory)
				{
					if ((this._territory == null))
					{
						this._territory = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Territory>("Territory");
					}
					return this._territory;
				}
			}
		}

		private object _lockerterritory = new object();

		/// <summary>
		/// The internal reference variable for the 'Territory' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Territory> _territory;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Alphabeticallistofproducts> Alphabeticallistofproducts
		{
			get
			{
				lock (_lockeralphabeticallistofproducts)
				{
					if ((this._alphabeticallistofproducts == null))
					{
						this._alphabeticallistofproducts = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Alphabeticallistofproducts>("Alphabeticallistofproducts");
					}
					return this._alphabeticallistofproducts;
				}
			}
		}

		private object _lockeralphabeticallistofproducts = new object();

		/// <summary>
		/// The internal reference variable for the 'Alphabeticallistofproducts' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Alphabeticallistofproducts> _alphabeticallistofproducts;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CategorySalesfor1997> CategorySalesfor1997
		{
			get
			{
				lock (_lockercategorysalesfor1997)
				{
					if ((this._categorysalesfor1997 == null))
					{
						this._categorysalesfor1997 = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.CategorySalesfor1997>("CategorySalesfor1997");
					}
					return this._categorysalesfor1997;
				}
			}
		}

		private object _lockercategorysalesfor1997 = new object();

		/// <summary>
		/// The internal reference variable for the 'CategorySalesfor1997' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CategorySalesfor1997> _categorysalesfor1997;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CurrentProductList> CurrentProductList
		{
			get
			{
				lock (_lockercurrentproductlist)
				{
					if ((this._currentproductlist == null))
					{
						this._currentproductlist = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.CurrentProductList>("CurrentProductList");
					}
					return this._currentproductlist;
				}
			}
		}

		private object _lockercurrentproductlist = new object();

		/// <summary>
		/// The internal reference variable for the 'CurrentProductList' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CurrentProductList> _currentproductlist;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CustomerandSuppliersbyCity> CustomerandSuppliersbyCity
		{
			get
			{
				lock (_lockercustomerandsuppliersbycity)
				{
					if ((this._customerandsuppliersbycity == null))
					{
						this._customerandsuppliersbycity = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.CustomerandSuppliersbyCity>("CustomerandSuppliersbyCity");
					}
					return this._customerandsuppliersbycity;
				}
			}
		}

		private object _lockercustomerandsuppliersbycity = new object();

		/// <summary>
		/// The internal reference variable for the 'CustomerandSuppliersbyCity' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.CustomerandSuppliersbyCity> _customerandsuppliersbycity;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Invoices> Invoices
		{
			get
			{
				lock (_lockerinvoices)
				{
					if ((this._invoices == null))
					{
						this._invoices = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.Invoices>("Invoices");
					}
					return this._invoices;
				}
			}
		}

		private object _lockerinvoices = new object();

		/// <summary>
		/// The internal reference variable for the 'Invoices' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.Invoices> _invoices;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrderDetailsExtended> OrderDetailsExtended
		{
			get
			{
				lock (_lockerorderdetailsextended)
				{
					if ((this._orderdetailsextended == null))
					{
						this._orderdetailsextended = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.OrderDetailsExtended>("OrderDetailsExtended");
					}
					return this._orderdetailsextended;
				}
			}
		}

		private object _lockerorderdetailsextended = new object();

		/// <summary>
		/// The internal reference variable for the 'OrderDetailsExtended' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrderDetailsExtended> _orderdetailsextended;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrdersQry> OrdersQry
		{
			get
			{
				lock (_lockerordersqry)
				{
					if ((this._ordersqry == null))
					{
						this._ordersqry = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.OrdersQry>("OrdersQry");
					}
					return this._ordersqry;
				}
			}
		}

		private object _lockerordersqry = new object();

		/// <summary>
		/// The internal reference variable for the 'OrdersQry' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrdersQry> _ordersqry;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrderSubtotals> OrderSubtotals
		{
			get
			{
				lock (_lockerordersubtotals)
				{
					if ((this._ordersubtotals == null))
					{
						this._ordersubtotals = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.OrderSubtotals>("OrderSubtotals");
					}
					return this._ordersubtotals;
				}
			}
		}

		private object _lockerordersubtotals = new object();

		/// <summary>
		/// The internal reference variable for the 'OrderSubtotals' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.OrderSubtotals> _ordersubtotals;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.ProductsAboveAveragePrice> ProductsAboveAveragePrice
		{
			get
			{
				lock (_lockerproductsaboveaverageprice)
				{
					if ((this._productsaboveaverageprice == null))
					{
						this._productsaboveaverageprice = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.ProductsAboveAveragePrice>("ProductsAboveAveragePrice");
					}
					return this._productsaboveaverageprice;
				}
			}
		}

		private object _lockerproductsaboveaverageprice = new object();

		/// <summary>
		/// The internal reference variable for the 'ProductsAboveAveragePrice' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.ProductsAboveAveragePrice> _productsaboveaverageprice;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.ProductSalesfor1997> ProductSalesfor1997
		{
			get
			{
				lock (_lockerproductsalesfor1997)
				{
					if ((this._productsalesfor1997 == null))
					{
						this._productsalesfor1997 = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.ProductSalesfor1997>("ProductSalesfor1997");
					}
					return this._productsalesfor1997;
				}
			}
		}

		private object _lockerproductsalesfor1997 = new object();

		/// <summary>
		/// The internal reference variable for the 'ProductSalesfor1997' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.ProductSalesfor1997> _productsalesfor1997;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.ProductsbyCategory> ProductsbyCategory
		{
			get
			{
				lock (_lockerproductsbycategory)
				{
					if ((this._productsbycategory == null))
					{
						this._productsbycategory = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.ProductsbyCategory>("ProductsbyCategory");
					}
					return this._productsbycategory;
				}
			}
		}

		private object _lockerproductsbycategory = new object();

		/// <summary>
		/// The internal reference variable for the 'ProductsbyCategory' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.ProductsbyCategory> _productsbycategory;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.QuarterlyOrders> QuarterlyOrders
		{
			get
			{
				lock (_lockerquarterlyorders)
				{
					if ((this._quarterlyorders == null))
					{
						this._quarterlyorders = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.QuarterlyOrders>("QuarterlyOrders");
					}
					return this._quarterlyorders;
				}
			}
		}

		private object _lockerquarterlyorders = new object();

		/// <summary>
		/// The internal reference variable for the 'QuarterlyOrders' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.QuarterlyOrders> _quarterlyorders;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SalesbyCategory> SalesbyCategory
		{
			get
			{
				lock (_lockersalesbycategory)
				{
					if ((this._salesbycategory == null))
					{
						this._salesbycategory = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.SalesbyCategory>("SalesbyCategory");
					}
					return this._salesbycategory;
				}
			}
		}

		private object _lockersalesbycategory = new object();

		/// <summary>
		/// The internal reference variable for the 'SalesbyCategory' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SalesbyCategory> _salesbycategory;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SalesTotalsbyAmount> SalesTotalsbyAmount
		{
			get
			{
				lock (_lockersalestotalsbyamount)
				{
					if ((this._salestotalsbyamount == null))
					{
						this._salestotalsbyamount = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.SalesTotalsbyAmount>("SalesTotalsbyAmount");
					}
					return this._salestotalsbyamount;
				}
			}
		}

		private object _lockersalestotalsbyamount = new object();

		/// <summary>
		/// The internal reference variable for the 'SalesTotalsbyAmount' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SalesTotalsbyAmount> _salestotalsbyamount;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SummaryofSalesbyQuarter> SummaryofSalesbyQuarter
		{
			get
			{
				lock (_lockersummaryofsalesbyquarter)
				{
					if ((this._summaryofsalesbyquarter == null))
					{
						this._summaryofsalesbyquarter = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.SummaryofSalesbyQuarter>("SummaryofSalesbyQuarter");
					}
					return this._summaryofsalesbyquarter;
				}
			}
		}

		private object _lockersummaryofsalesbyquarter = new object();

		/// <summary>
		/// The internal reference variable for the 'SummaryofSalesbyQuarter' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SummaryofSalesbyQuarter> _summaryofsalesbyquarter;

		/// <summary>
		/// 
		/// </summary>
		public virtual System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SummaryofSalesbyYear> SummaryofSalesbyYear
		{
			get
			{
				lock (_lockersummaryofsalesbyyear)
				{
					if ((this._summaryofsalesbyyear == null))
					{
						this._summaryofsalesbyyear = base.CreateObjectSet<Acme.Northwind.EFDAL.Entity.SummaryofSalesbyYear>("SummaryofSalesbyYear");
					}
					return this._summaryofsalesbyyear;
				}
			}
		}

		private object _lockersummaryofsalesbyyear = new object();

		/// <summary>
		/// The internal reference variable for the 'SummaryofSalesbyYear' object set
		/// </summary>
		protected System.Data.Objects.ObjectSet<Acme.Northwind.EFDAL.Entity.SummaryofSalesbyYear> _summaryofsalesbyyear;

		#region AddItem Methods

		/// <summary>
		/// Adds an entity to the object context
		/// </summary>
		/// <param name="entity"></param>
		public virtual void AddItem(nHydrate.EFCore.DataAccess.IBusinessObject entity)
		{
			this.AddItem(entity);
		}

		/// <summary>
		/// Adds an entity of type 'Category' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.ICategory entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Category)
			{
				((Acme.Northwind.EFDAL.Entity.Category)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Category)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Category", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Customer' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.ICustomer entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Customer)
			{
				((Acme.Northwind.EFDAL.Entity.Customer)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Customer)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Customer", entity);
		}

		/// <summary>
		/// Adds an entity of type 'CustomerCustomerDemo' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerCustomerDemo entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo)
			{
				((Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("CustomerCustomerDemo", entity);
		}

		/// <summary>
		/// Adds an entity of type 'CustomerDemographic' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerDemographic entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.CustomerDemographic)
			{
				((Acme.Northwind.EFDAL.Entity.CustomerDemographic)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.CustomerDemographic)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("CustomerDemographic", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Employee' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IEmployee entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Employee)
			{
				((Acme.Northwind.EFDAL.Entity.Employee)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Employee)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Employee", entity);
		}

		/// <summary>
		/// Adds an entity of type 'EmployeeTerritorie' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IEmployeeTerritorie entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.EmployeeTerritorie)
			{
				((Acme.Northwind.EFDAL.Entity.EmployeeTerritorie)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.EmployeeTerritorie)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("EmployeeTerritorie", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Order' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IOrder entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Order)
			{
				((Acme.Northwind.EFDAL.Entity.Order)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Order)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Order", entity);
		}

		/// <summary>
		/// Adds an entity of type 'OrderDetail' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IOrderDetail entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.OrderDetail)
			{
				((Acme.Northwind.EFDAL.Entity.OrderDetail)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.OrderDetail)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("OrderDetail", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Product' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IProduct entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Product)
			{
				((Acme.Northwind.EFDAL.Entity.Product)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Product)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Product", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Region' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IRegion entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Region)
			{
				((Acme.Northwind.EFDAL.Entity.Region)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Region)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Region", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Shipper' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.IShipper entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Shipper)
			{
				((Acme.Northwind.EFDAL.Entity.Shipper)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Shipper)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Shipper", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Supplier' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.ISupplier entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Supplier)
			{
				((Acme.Northwind.EFDAL.Entity.Supplier)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Supplier)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Supplier", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Territory' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Interfaces.Entity.ITerritory entity)
		{
			if (entity is Acme.Northwind.EFDAL.Entity.Territory)
			{
				((Acme.Northwind.EFDAL.Entity.Territory)entity).CreatedBy = _contextStartup.Modifer;
				((Acme.Northwind.EFDAL.Entity.Territory)entity).ModifiedBy = _contextStartup.Modifer;
			}
			base.AddObject("Territory", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Alphabeticallistofproducts' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.Alphabeticallistofproducts entity)
		{
			base.AddObject("Alphabeticallistofproducts", entity);
		}

		/// <summary>
		/// Adds an entity of type 'CategorySalesfor1997' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.CategorySalesfor1997 entity)
		{
			base.AddObject("CategorySalesfor1997", entity);
		}

		/// <summary>
		/// Adds an entity of type 'CurrentProductList' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.CurrentProductList entity)
		{
			base.AddObject("CurrentProductList", entity);
		}

		/// <summary>
		/// Adds an entity of type 'CustomerandSuppliersbyCity' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.CustomerandSuppliersbyCity entity)
		{
			base.AddObject("CustomerandSuppliersbyCity", entity);
		}

		/// <summary>
		/// Adds an entity of type 'Invoices' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.Invoices entity)
		{
			base.AddObject("Invoices", entity);
		}

		/// <summary>
		/// Adds an entity of type 'OrderDetailsExtended' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.OrderDetailsExtended entity)
		{
			base.AddObject("OrderDetailsExtended", entity);
		}

		/// <summary>
		/// Adds an entity of type 'OrdersQry' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.OrdersQry entity)
		{
			base.AddObject("OrdersQry", entity);
		}

		/// <summary>
		/// Adds an entity of type 'OrderSubtotals' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.OrderSubtotals entity)
		{
			base.AddObject("OrderSubtotals", entity);
		}

		/// <summary>
		/// Adds an entity of type 'ProductsAboveAveragePrice' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.ProductsAboveAveragePrice entity)
		{
			base.AddObject("ProductsAboveAveragePrice", entity);
		}

		/// <summary>
		/// Adds an entity of type 'ProductSalesfor1997' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.ProductSalesfor1997 entity)
		{
			base.AddObject("ProductSalesfor1997", entity);
		}

		/// <summary>
		/// Adds an entity of type 'ProductsbyCategory' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.ProductsbyCategory entity)
		{
			base.AddObject("ProductsbyCategory", entity);
		}

		/// <summary>
		/// Adds an entity of type 'QuarterlyOrders' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.QuarterlyOrders entity)
		{
			base.AddObject("QuarterlyOrders", entity);
		}

		/// <summary>
		/// Adds an entity of type 'SalesbyCategory' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.SalesbyCategory entity)
		{
			base.AddObject("SalesbyCategory", entity);
		}

		/// <summary>
		/// Adds an entity of type 'SalesTotalsbyAmount' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.SalesTotalsbyAmount entity)
		{
			base.AddObject("SalesTotalsbyAmount", entity);
		}

		/// <summary>
		/// Adds an entity of type 'SummaryofSalesbyQuarter' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.SummaryofSalesbyQuarter entity)
		{
			base.AddObject("SummaryofSalesbyQuarter", entity);
		}

		/// <summary>
		/// Adds an entity of type 'SummaryofSalesbyYear' to the object context.
		/// </summary>
		/// <param name="entity">The entity to add</param>
		public virtual void AddItem(Acme.Northwind.EFDAL.Entity.SummaryofSalesbyYear entity)
		{
			base.AddObject("SummaryofSalesbyYear", entity);
		}

		/// <summary>
		/// Adds an object to the object context.
		/// </summary>
		[Obsolete("This method signature is no longer used. Use the AddItem method.", true)]
		[System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
		public new void AddObject(string entitySetName, object entity)
		{
			throw new Exception("This method signature is no longer used. Use the AddItem method.");
		}

		#endregion

		#region DeleteItem Methods

		/// <summary>
		/// Marks an entity for deletion.
		/// </summary>
		/// <param name="entity">An enttiy to delete. The object can be in any state except System.Data.EntityState.Detached.</param>
		public virtual void DeleteItem(nHydrate.EFCore.DataAccess.IBusinessObject entity)
		{
			if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ITerritory) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ISupplier) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IShipper) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IRegion) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IProduct) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IOrder) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IOrderDetail) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IEmployeeTerritorie) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IEmployee) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICustomer) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerDemographic) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerCustomerDemo) base.DeleteObject(entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICategory) base.DeleteObject(entity);
			else throw new Exception("An entity of this type cannot deleted!");
		}

		/// <summary>
		/// Marks a set of entities for deletion.
		/// </summary>
		/// <param name="entityList">A list of NHEntityObject objects to mark for deletion</param>
		public virtual void DeleteItem(IEnumerable<nHydrate.EFCore.DataAccess.IBusinessObject> entityList)
		{
			foreach (var item in entityList)
			{
				entityList.ToList().ForEach(x => this.DeleteItem(x));
			}
		}

		/// <summary>
		/// Marks an object for deletion.
		/// </summary>
		[Obsolete("This method signature is no longer used. Use the AddItem method.", true)]
		[System.ComponentModel.EditorBrowsable(EditorBrowsableState.Never)]
		public new void DeleteObject(object entity)
		{
			this.DeleteItem((nHydrate.EFCore.DataAccess.IBusinessObject)entity);
		}

		#endregion

		internal static string GetConnectionString()
		{
			string s = System.Configuration.ConfigurationManager.ConnectionStrings["NorthwindEntities"].ConnectionString;
			System.Text.RegularExpressions.Regex regEx = new System.Text.RegularExpressions.Regex("provider connection string\\s*=\\s*\"([^\"]*)");
			System.Text.RegularExpressions.Match m = regEx.Match(s);
			string connString = string.Empty;
			if (m != null && m.Groups.Count > 1)
			{
				connString = m.Groups[1].Value;
			}
			return connString;
		}

		private string GetConnString()
		{
			string s = this.Connection.ConnectionString;
			System.Text.RegularExpressions.Regex regEx = new System.Text.RegularExpressions.Regex("provider connection string\\s*=\\s*\"([^\"]*)");
			System.Text.RegularExpressions.Match m = regEx.Match(s);
			string connString = string.Empty;
			if (m != null && m.Groups.Count > 1)
			{
				connString = m.Groups[1].Value;
			}
			return connString;
		}

		/// <summary>
		/// The global settings of this context
		/// </summary>
		public ContextStartup ContextStartup
		{
			get { return _contextStartup; }
		}

		#region INorthwind Members

		void Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.AddItem(nHydrate.EFCore.DataAccess.IBusinessObject entity)
		{
			if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICategory) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.ICategory)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICustomer) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.ICustomer)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerCustomerDemo) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerCustomerDemo)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerDemographic) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerDemographic)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IEmployee) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IEmployee)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IEmployeeTerritorie) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IEmployeeTerritorie)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IOrder) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IOrder)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IOrderDetail) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IOrderDetail)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IProduct) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IProduct)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IRegion) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IRegion)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.IShipper) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.IShipper)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ISupplier) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.ISupplier)entity);
			else if (entity is Acme.Northwind.EFDAL.Interfaces.Entity.ITerritory) this.AddItem((Acme.Northwind.EFDAL.Interfaces.Entity.ITerritory)entity);
			else throw new Exception("Entity type not found");
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICategory> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Category
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICategory>)this.Category; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICustomer> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Customer
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICustomer>)this.Customer; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerCustomerDemo> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.CustomerCustomerDemo
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerCustomerDemo>)this.CustomerCustomerDemo; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerDemographic> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.CustomerDemographic
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ICustomerDemographic>)this.CustomerDemographic; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IEmployee> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Employee
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IEmployee>)this.Employee; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IEmployeeTerritorie> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.EmployeeTerritorie
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IEmployeeTerritorie>)this.EmployeeTerritorie; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IOrder> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Order
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IOrder>)this.Order; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IOrderDetail> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.OrderDetail
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IOrderDetail>)this.OrderDetail; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IProduct> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Product
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IProduct>)this.Product; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IRegion> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Region
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IRegion>)this.Region; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IShipper> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Shipper
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.IShipper>)this.Shipper; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ISupplier> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Supplier
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ISupplier>)this.Supplier; }
		}

		System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ITerritory> Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.Territory
		{
			get { return (System.Data.Objects.IObjectSet<Acme.Northwind.EFDAL.Interfaces.Entity.ITerritory>)this.Territory; }
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<CategorizedSales> CategorizedSales(string categoryname, string ordyear)
		{
			ObjectParameter categorynameParameter = null;
			if (categoryname != null) { categorynameParameter = new ObjectParameter("CategoryName", categoryname); }
			else { categorynameParameter = new ObjectParameter("CategoryName", typeof(string)); }
			ObjectParameter ordyearParameter = null;
			if (ordyear != null) { ordyearParameter = new ObjectParameter("OrdYear", ordyear); }
			else { ordyearParameter = new ObjectParameter("OrdYear", typeof(string)); }
			var retval = base.ExecuteFunction<CategorizedSales>("SalesByCategory", categorynameParameter, ordyearParameter).ToList();
			return retval;
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<CustOrderHist> CustOrderHist(string customerid)
		{
			ObjectParameter customeridParameter = null;
			if (customerid != null) { customeridParameter = new ObjectParameter("CustomerID", customerid); }
			else { customeridParameter = new ObjectParameter("CustomerID", typeof(string)); }
			var retval = base.ExecuteFunction<CustOrderHist>("CustOrderHist", customeridParameter).ToList();
			return retval;
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<CustOrdersDetail> CustOrdersDetail(int? orderid)
		{
			ObjectParameter orderidParameter = null;
			if (orderid != null) { orderidParameter = new ObjectParameter("OrderID", orderid); }
			else { orderidParameter = new ObjectParameter("OrderID", typeof(int?)); }
			var retval = base.ExecuteFunction<CustOrdersDetail>("CustOrdersDetail", orderidParameter).ToList();
			return retval;
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<CustOrdersOrders> CustOrdersOrders(string customerid)
		{
			ObjectParameter customeridParameter = null;
			if (customerid != null) { customeridParameter = new ObjectParameter("CustomerID", customerid); }
			else { customeridParameter = new ObjectParameter("CustomerID", typeof(string)); }
			var retval = base.ExecuteFunction<CustOrdersOrders>("CustOrdersOrders", customeridParameter).ToList();
			return retval;
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<EmployeeSalesbyCountry> EmployeeSalesbyCountry(DateTime? beginningDate, DateTime? endingDate)
		{
			ObjectParameter beginningDateParameter = null;
			if (beginningDate != null) { beginningDateParameter = new ObjectParameter("Beginning_Date", beginningDate); }
			else { beginningDateParameter = new ObjectParameter("Beginning_Date", typeof(DateTime?)); }
			ObjectParameter endingDateParameter = null;
			if (endingDate != null) { endingDateParameter = new ObjectParameter("Ending_Date", endingDate); }
			else { endingDateParameter = new ObjectParameter("Ending_Date", typeof(DateTime?)); }
			var retval = base.ExecuteFunction<EmployeeSalesbyCountry>("Employee Sales by Country", beginningDateParameter, endingDateParameter).ToList();
			return retval;
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<SalesbyYear> SalesbyYear(DateTime? beginningDate, DateTime? endingDate)
		{
			ObjectParameter beginningDateParameter = null;
			if (beginningDate != null) { beginningDateParameter = new ObjectParameter("Beginning_Date", beginningDate); }
			else { beginningDateParameter = new ObjectParameter("Beginning_Date", typeof(DateTime?)); }
			ObjectParameter endingDateParameter = null;
			if (endingDate != null) { endingDateParameter = new ObjectParameter("Ending_Date", endingDate); }
			else { endingDateParameter = new ObjectParameter("Ending_Date", typeof(DateTime?)); }
			var retval = base.ExecuteFunction<SalesbyYear>("Sales by Year", beginningDateParameter, endingDateParameter).ToList();
			return retval;
		}

		/// <summary>
		/// 
		/// </summary>
		public IEnumerable<TenMostExpensiveProducts> TenMostExpensiveProducts()
		{
			var retval = base.ExecuteFunction<TenMostExpensiveProducts>("Ten Most Expensive Products").ToList();
			return retval;
		}

		void Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.DeleteItem(IEnumerable<nHydrate.EFCore.DataAccess.IBusinessObject> entityList)
		{
			foreach (var entity in entityList)
			{
				this.DeleteItem(entity);
			}
		}

		void Acme.Northwind.EFDAL.Interfaces.INorthwindEntities.DeleteItem(nHydrate.EFCore.DataAccess.IBusinessObject entity)
		{
			this.DeleteItem(entity);
		}
		#endregion

		/// <summary>
		/// Determines the version of the model that created this library.
		/// </summary>
		public virtual string Version
		{
			get { return "0.0.0.0.3"; }
		}

		/// <summary>
		/// Determines the key of the model that created this library.
		/// </summary>
		public virtual string ModelKey
		{
			get { return "1aeb9949-ba47-477b-bfdf-c06fe5872e85"; }
		}

		/// <summary>
		/// Determines if the API matches the database connection
		/// </summary>
		/// <returns></returns>
		public virtual bool IsValidConnection()
		{
			return IsValidConnection(true);
		}

		/// <summary>
		/// Determines if the API matches the database connection
		/// </summary>
		/// <param name="checkVersion">Determines if the check also includes the exact version of the model</param>
		/// <returns></returns>
		public virtual bool IsValidConnection(bool checkVersion)
		{
			if (string.IsNullOrEmpty(GetConnectionString()))
				return false;

			string modelKey = GetDatabaseExtendedProperty(GetConnectionString(), "ModelKey");
			if (string.Compare(this.ModelKey, modelKey, true) != 0)
				return false;

			if (checkVersion)
			{
				string dbVersion = GetDatabaseExtendedProperty(GetConnectionString(), "dbVersion");
				if (dbVersion != this.Version)
					return false;
			}

			return true;
		}

		private static string GetDatabaseExtendedProperty(string connectionString, string propertyName)
		{
			string returnVal = string.Empty;
			returnVal = SelectExtendedProperty(connectionString, propertyName, string.Empty, string.Empty, string.Empty);
			return returnVal;
		}

		private static string SelectExtendedProperty(string connectionString, string property, string user, string table, string parameter)
		{
			string returnVal = string.Empty;
			string userName = string.Empty;
			string userValue = string.Empty;
			string tableName = string.Empty;
			string tableValue = string.Empty;
			string columnName = string.Empty;
			string columnValue = string.Empty;

			property = "'" + property + "'";
			if (user == string.Empty)
			{
				userName = "NULL";
				userValue = "NULL";
			}
			else
			{
				userName = "'user'";
				userValue = "'" + user + "'";
			}
			if (table == string.Empty)
			{
				tableName = "NULL";
				tableValue = "NULL";
			}
			else
			{
				tableName = "'table'";
				tableValue = "'" + table + "'";
			}
			if (parameter == string.Empty)
			{
				columnName = "NULL";
				columnValue = "NULL";
			}
			else
			{
				columnName = "'parameter'";
				columnValue = "'" + parameter + "'";
			}

			System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
			System.Data.SqlClient.SqlDataReader externalReader = null;
			try
			{
				conn.ConnectionString = connectionString;
				conn.Open();
				var cmdGetExtProp = new System.Data.SqlClient.SqlCommand();
				cmdGetExtProp.CommandText = String.Format("SELECT value FROM ::fn_listextendedproperty({0}, {1}, {2}, {3}, {4}, {5}, {6})", new object[] { property, userName, userValue, tableName, tableValue, columnName, columnValue });
				cmdGetExtProp.CommandType = System.Data.CommandType.Text;
				cmdGetExtProp.Connection = conn;
				externalReader = cmdGetExtProp.ExecuteReader();
				if (externalReader.Read())
				{
					if (externalReader[0] != System.DBNull.Value)
					{
						returnVal = externalReader.GetString(0);
					}
				}
			}
			catch (Exception ex)
			{
				throw ex;
			}
			finally
			{
				if (externalReader != null)
					externalReader.Close();
				if (conn != null)
					conn.Close();
			}
			return returnVal;
		}

		/// <summary>
		/// Persists all updates to the data source and resets change tracking in the object context.
		/// </summary>
		/// <param name="options"></param>
		/// <returns>The number of objects in an System.Data.EntityState.Added, System.Data.EntityState.Modified, or System.Data.EntityState.Deleted state when System.Data.Objects.ObjectContext.SaveChanges() was called.</returns>
		public override int SaveChanges(SaveOptions options)
		{
			//Process deleted list
			var deletedList = this.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Deleted);
			foreach (var item in deletedList)
			{
				var entity = item.Entity as nHydrate.EFCore.DataAccess.IAuditable;
				if (entity != null)
				{
					if (entity.IsModifyAuditImplemented && entity.ModifiedBy != this.ContextStartup.Modifer)
					{
						System.Data.SqlClient.SqlConnection connection = null;
						try
						{
							connection = new System.Data.SqlClient.SqlConnection(GetConnectionString());
							connection.Open();
							System.Data.SqlClient.SqlCommand command = null;
							if (command != null)
							{
								command.CommandType = System.Data.CommandType.Text;
								if (this.ContextStartup.Modifer == null)
									command.Parameters.Add(new System.Data.SqlClient.SqlParameter("@mod", System.DBNull.Value));
								else
									command.Parameters.Add(new System.Data.SqlClient.SqlParameter("@mod", this.ContextStartup.Modifer));
								command.ExecuteNonQuery();
							}
						}
						catch
						{
							throw;
						}
						finally
						{
							if (connection != null && connection.State == System.Data.ConnectionState.Open)
								connection.Close();
						}
					}
				}
			}

			//Process added list
			var addedList = this.ObjectStateManager.GetObjectStateEntries(System.Data.EntityState.Added);
			foreach (var item in addedList)
			{
				var entity = item.Entity as nHydrate.EFCore.DataAccess.IAuditable;
				if (entity != null)
				{
					if (entity.IsModifyAuditImplemented && entity.ModifiedBy != this.ContextStartup.Modifer)
					{
						if (entity is Acme.Northwind.EFDAL.Entity.Category) ((Acme.Northwind.EFDAL.Entity.Category)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Customer) ((Acme.Northwind.EFDAL.Entity.Customer)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo) ((Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.CustomerDemographic) ((Acme.Northwind.EFDAL.Entity.CustomerDemographic)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Employee) ((Acme.Northwind.EFDAL.Entity.Employee)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.EmployeeTerritorie) ((Acme.Northwind.EFDAL.Entity.EmployeeTerritorie)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Order) ((Acme.Northwind.EFDAL.Entity.Order)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.OrderDetail) ((Acme.Northwind.EFDAL.Entity.OrderDetail)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Product) ((Acme.Northwind.EFDAL.Entity.Product)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Region) ((Acme.Northwind.EFDAL.Entity.Region)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Shipper) ((Acme.Northwind.EFDAL.Entity.Shipper)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Supplier) ((Acme.Northwind.EFDAL.Entity.Supplier)entity).ResetCreatedBy(this.ContextStartup.Modifer);
						else if (entity is Acme.Northwind.EFDAL.Entity.Territory) ((Acme.Northwind.EFDAL.Entity.Territory)entity).ResetCreatedBy(this.ContextStartup.Modifer);
					}
				}
			}

			return base.SaveChanges(options);
		}

		#region GetEntityFromField

		Enum nHydrate.EFCore.DataAccess.IContext.GetEntityFromField(Enum field)
		{
			return GetEntityFromField(field);
		}

		nHydrate.EFCore.DataAccess.IMetadata nHydrate.EFCore.DataAccess.IContext.GetMetaData(Enum entity)
		{
			return GetMetaData((EntityMappingConstants)entity);
		}

		System.Type nHydrate.EFCore.DataAccess.IContext.GetFieldType(Enum field)
		{
			return this.GetFieldType(field);
		}

		/// <summary>
		/// Determines the entity from one of its fields
		/// </summary>
		public static EntityMappingConstants GetEntityFromField(Enum field)
		{
			if (field is Acme.Northwind.EFDAL.Entity.Category.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Category;
			if (field is Acme.Northwind.EFDAL.Entity.Customer.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Customer;
			if (field is Acme.Northwind.EFDAL.Entity.CustomerCustomerDemo.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.CustomerCustomerDemo;
			if (field is Acme.Northwind.EFDAL.Entity.CustomerDemographic.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.CustomerDemographic;
			if (field is Acme.Northwind.EFDAL.Entity.Employee.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Employee;
			if (field is Acme.Northwind.EFDAL.Entity.EmployeeTerritorie.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.EmployeeTerritorie;
			if (field is Acme.Northwind.EFDAL.Entity.Order.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Order;
			if (field is Acme.Northwind.EFDAL.Entity.OrderDetail.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.OrderDetail;
			if (field is Acme.Northwind.EFDAL.Entity.Product.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Product;
			if (field is Acme.Northwind.EFDAL.Entity.Region.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Region;
			if (field is Acme.Northwind.EFDAL.Entity.Shipper.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Shipper;
			if (field is Acme.Northwind.EFDAL.Entity.Supplier.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Supplier;
			if (field is Acme.Northwind.EFDAL.Entity.Territory.FieldNameConstants) return Acme.Northwind.EFDAL.EntityMappingConstants.Territory;
			throw new Exception("Unknown field type!");
		}

		/// <summary>
		/// Gets the meta data object for an entity
		/// </summary>
		public static nHydrate.EFCore.DataAccess.IMetadata GetMetaData(Acme.Northwind.EFDAL.EntityMappingConstants table)
		{
			switch (table)
			{
				case Acme.Northwind.EFDAL.EntityMappingConstants.Category: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.CategoryMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Customer: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.CustomerMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.CustomerCustomerDemo: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.CustomerCustomerDemoMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.CustomerDemographic: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.CustomerDemographicMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Employee: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.EmployeeMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.EmployeeTerritorie: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.EmployeeTerritorieMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Order: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.OrderMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.OrderDetail: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.OrderDetailMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Product: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.ProductMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Region: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.RegionMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Shipper: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.ShipperMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Supplier: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.SupplierMetadata();
				case Acme.Northwind.EFDAL.EntityMappingConstants.Territory: return new Acme.Northwind.EFDAL.Interfaces.Entity.Metadata.TerritoryMetadata();
			}
			throw new Exception("Entity not found!");
		}

		#endregion

	}

	#endregion

}

namespace Acme.Northwind.EFDAL.Entity
{
}

